using System;
using System.Collections.Generic;
using Admin.Core.Common.BaseModel;
using FreeSql.DataAnnotations;

namespace Admin.Core.Model.Admin
{
    /// <summary>
    /// 用户
    /// </summary>
	[Table(Name = "AD_USER")]
    [Index("uk_user_username", nameof(UserName), true)]
    public class UserEntity: EntityBase
    {
        /// <summary>
        /// 账号
        /// </summary>
        [Column(StringLength = 60, Name = "USERNAME")]//
        public string UserName { get; set; }


        /// <summary>
        /// 域账号
        /// </summary>
        [Column(StringLength = 60, Name = "DOMAINACCNAME")]
        public string DomainAccName { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [Column(StringLength = 60, Name = "PASSWORD")]//
        public string Password { get; set; }

        /// <summary>
        /// 昵称
        /// </summary>
        [Column(StringLength = 60, Name = "NICKNAME")] //
        public string NickName { get; set; }

        /// <summary>
        /// 头像
        /// </summary>
       [Column(StringLength = 100, Name = "AVATAR")]//
        public string Avatar { get; set; }


        /// <summary>
        /// 邮箱地址
        /// </summary>
        [Column(Name = "EMAIL")]//
        public string Email { get; set; }
        /// <summary>
        /// 状态
        /// </summary>
        [Column(Name = "STATUS")]
        public int Status { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [Column(StringLength = 500, Name = "REMARK")] //
        public string Remark { get; set; }

        [Navigate(ManyToMany = typeof(UserRoleEntity))]
        public ICollection<RoleEntity> Roles { get; set; }

        public ICollection<UserRoleEntity> UserRole { get; set; }

        public ICollection<UserTenantEntity> UserTenants { get; set; }

        [Navigate(ManyToMany = typeof(UserTenantEntity))]
        public ICollection<TenantEntity> Tenants { get; set; }
    }
}
